import * as React from "react";
import { IFile } from "../../types";
import { baseApi } from "../../axios";

interface IProps {
    file: IFile;
    fileChange(name: string, change: boolean): void;
}

const List: React.FC<IProps> = function ({ file, fileChange }) {
    return (
        <li>
            <a href={baseApi + file.name} rel="noreferrer" target="_blank">
                {" "}
                <img src="./assets/images/file.png" alt="文件夹" />
                {file.name}
            </a>
            <input type="checkbox" checked={file.change} onChange={() => fileChange(file.name, !file.change)} />
        </li>
    );
};

export default List;
